<%--
  Created by IntelliJ IDEA.
  User: 莫
  Date: 2018/1/8
  Time: 19:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Login</title>
    <style>
        *{
            margin: 0; /*清楚外边距*/
        }
        html{
            height: 100%;
            font: 16px;
        }
        body{
            display: flex;  /*弹性盒模型*/
            /*主轴方向上内部元素排序方式：居中*/
            justify-content: center;
            /*辅轴方向上内部元素排序方式：居中*/
            align-items: center;
            height: 100%;
            background-image: url(img/timg1.jpg);
        }
        .login-wrap{
            width: 400px;
            height: 500px;
            background-color: rgb(252, 244, 244);
            border-radius: 8px;
        }
        .login-wrap:before{
            display: block;/*以块元素展示*/
            content: '';/*激活伪元素*/
            width: 100%;
            height: 6px;
            /*渐变色 left 从左到右渐变*/
            background: -webkit-linear-gradient(left,#27ae60 0%,#27ae60 20%,#6633ff 20%,#6633ff 40%,#3399ff 40%,#6633ff 60%,#ff0066 60%,#ff0066 80%,#3de93d 80%,#3de93d 100%);
            border-radius: 8px 8px 0 0;/*顺时针*/
        }
        .login-wrap h2{
            font-size: 2em;/*默认16px 具有弹性 以整体字体大小为基础变化*/
            color:#368;
            text-align: center;
            line-height: 80px;
        }
        .login-content{
            /*具备可读性，方便别人知道是哪一个使用这个类名
            非div 元素需要先写元素名*/
            display: flex;/*横向排*/
            /*主轴方向：column纵向 row横向*/
            flex-direction: column;
            /*主轴方向内部元素排序方式，均分*/
            justify-content: space-around;
            /*辅轴方向内部元素排序：居中*/
            align-items: center;
            width: 100%;
            height: 357px;
            background-color: rgb(245, 227, 227);
        }
        .login-content input{
            width: 80%;
            height: 40px;
            /*边框 粗细 样式 颜色*/
            font-size: 1em;
            border: 3px solid #bbb;
            outline: 0;
            text-indent: 1em;/*首行缩进*/
            border-radius: 5px;
        }
        .login-content button{
            width: 80%;
            height: 40px;
            border-top-style: none;
            border-right-style: none;
            border-bottom-style: none;
            border-left-style: none;
            border-radius: 5px;
            background-color: #e99676;
        }
        h3{
            float: left;
        }
    </style>
</head>
<body>
<div class="login-wrap">
    <!-- 没有实际意义的空标签,用伪元素before after代替<div class="ribon"></div> -->
    <h2>Login</h2>
    <div class="login-content">
        <h3>昵称</h3>
        <input type="text" name="userName" placeholder="请输入昵称" id="input_userName">
        <h3>账号</h3>
        <input type="password" name="userAccount" placeholder="请输入账号" id="input_userAccount">
        <h3>密码</h3>
        <input type="text" name="userPwd" placeholder="请输入密码" id="input_userPwd">
        <!-- <input type="submit" value="sign in"> -->
        <button  class="LoginBtn" id="LoginBtnID" onclick="LoginFN()">Sign in</button>
    </div>
</div>

<script>
    var xmlhttp;
    function LoginFN() {
        var input_account = document.getElementById("input_userAccount").value;
        var input_pwd = document.getElementById("input_userPwd").value;
        var input_name = document.getElementById("input_userName").value;

        if(input_account == "" || input_pwd == ""||input_name == "")
        {
            alert("Invalid value");
            return;
        }


        xmlhttp=new XMLHttpRequest();
        xmlhttp.open("POST","Registerhtml",false);
        xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
        xmlhttp.send("userAccount="+ input_account +"&userPwd=" + input_pwd + "&userName=" + input_name);


    }
</script>
</body>
</html>
